package com.epam.cdp.selenium2.core.configuration;

/**
 * Main configuration. Contains parameter needed for work.
 * 
 * @author yyudzitski
 */
public class GlobalConfiguration
{
  private static GlobalConfiguration configuration;

  private SeleniumConfiguration seleniumConfiguration;

  private TestngConfiguration testngConfiguration;

  private OptionsConfiguration optionsConfiguration;

  private String rootUrl;

  private GlobalConfiguration()
  {
    seleniumConfiguration = new SeleniumConfiguration();
    optionsConfiguration = new OptionsConfiguration();
    testngConfiguration = new TestngConfiguration();
  }

  public static GlobalConfiguration getInstance()
  {
    if( configuration == null )
    {
      configuration = new GlobalConfiguration();
    }
    return configuration;
  }

  public TestngConfiguration getTestngConfiguration()
  {
    return testngConfiguration;
  }

  public SeleniumConfiguration getSeleniumConfiguration()
  {
    return seleniumConfiguration;
  }

  public OptionsConfiguration getOptionsConfiguration()
  {
    return optionsConfiguration;
  }

  public void setRootUrl( String rootUrl )
  {
    this.rootUrl = rootUrl;
  }

  public String getRootUrl()
  {
    return rootUrl;
  }
}